//
//  MenuDarenTableViewCell.m
//  Products_B
//
//  Created by lanou on 16/6/3.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "MenuDarenTableViewCell.h"
#import "MenuDarenSmallModel.h"
@interface MenuDarenTableViewCell()
@property (nonatomic, strong)UIImageView *picImageView;
@property (nonatomic, strong)UILabel *nameLabel;
@property (nonatomic, strong)UILabel *contentLabel;


@end
@implementation MenuDarenTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.picImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 50, 50)];
        self.picImageView.layer.cornerRadius = 25;
        self.picImageView.layer.masksToBounds = YES;
        self.nameLabel = [[UILabel alloc]initWithFrame: CGRectMake(70, 20, 200, 20)];
        self.nameLabel.font = [UIFont systemFontOfSize:12];
        self.contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(70, 40, 200, 20)];
        self.contentLabel.textColor = [UIColor grayColor];
        self.contentLabel.font = [UIFont systemFontOfSize:12];
        self.zanButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        self.zanButton.frame = CGRectMake(40, 40, 20, 20);
        self.zanButton.layer.cornerRadius = 10;
        self.zanButton.layer.masksToBounds = YES;
        [self.zanButton setBackgroundImage:[UIImage imageNamed:@"menuwan2"] forState:(UIControlStateNormal)];
        self.guanzhuButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        [self.guanzhuButton setTintColor:[UIColor whiteColor]];
        [self.guanzhuButton setTitle:@"关注" forState:(UIControlStateNormal)];
        self.guanzhuButton.backgroundColor = [UIColor orangeColor];
        self.guanzhuButton.frame = CGRectMake(kWidth - 80, 20, 40, 30);
        self.imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 70, kWidth/3 - 1, 100)];
        self.imageView2 = [[UIImageView alloc]initWithFrame:CGRectMake(kWidth/3, 70, kWidth/3 - 1, 100)];
        self.imageView3 = [[UIImageView alloc]initWithFrame:CGRectMake(kWidth/3 *2, 70, kWidth/3 , 100)];
//        self.zanButton.backgroundColor = [UIColor magentaColor];
//        self.guanzhuButton.backgroundColor = [UIColor magentaColor];
        [self.contentView addSubview:_picImageView];
        [self.contentView addSubview:_nameLabel];
        [self.contentView addSubview:_contentLabel];
        [self.contentView addSubview:_zanButton];
        [self.contentView addSubview:_guanzhuButton];
        [self.contentView addSubview:_imageView1];
        [self.contentView addSubview:_imageView2];
        [self.contentView addSubview:_imageView3];
    }
    return self;
}
- (void)setModel:(MenuDarenModel *)model{
    _model = model;
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.head_img] placeholderImage:nil completed:nil];
    self.nameLabel.text = model.nick;
    self.contentLabel.text = model.declaration;
   
    
    [self.imageView1 sd_setImageWithURL:[NSURL URLWithString:[model.array[0] image]] placeholderImage:nil completed:nil];
    [self.imageView2 sd_setImageWithURL:[NSURL URLWithString:[model.array[1] image]] placeholderImage:nil completed:nil];
    [self.imageView3 sd_setImageWithURL:[NSURL URLWithString:[model.array[2] image]] placeholderImage:nil completed:nil];
    
}
@end
